<button class="btn btn-danger btn-xs" data-toggle="modal" style="margin-left:2px" data-target="#statusTrans{{ $id }}">
    启/禁用
</button>

<div class="modal fade" id="statusTrans{{ $id }}" tabindex="-1" role="dialog" aria-labelledby="statusTrans"
     aria-hidden="true">
    <div class="modal-dialog modal-xs">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true" style="font-size: 36px;">
                    &times;
                </button>
                <h4 class="modal-title" id="myModalLabel">启/禁用员工账户</h4>
            </div>
            <div class="modal-body">
                <div class="mb-3">
                    <label for="exampleFormControlInput1" class="form-label">用户名</label>
                    <input type="text" disabled value="{{ $username }}" class="form-control">
                </div>
                <div class="mb-3">
                    <label for="exampleFormControlInput1" class="form-label">昵称</label>
                    <input type="text" disabled value="{{ $name }}" class="form-control">
                </div>
                <div class="mb-3">
                    <label for="exampleFormControlInput1" class="form-label">账号状态</label>
                    <select name="status{{ $id }}" class="form-control">
                        <option value="0" {{ $status?'':'selected' }}>禁用</option>
                        <option value="1" {{ !$status?'':'selected' }}>启用</option>
                    </select>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                <button type="button" class="btn btn-primary" onclick="statusTrans({{ $id }})">确定</button>
            </div>
        </div>
    </div>
</div>
<script>
    function statusTrans(id) {
        ajaxPostFunc('/admin/ajax/stuffStatusTrans', {
            id: id,
            _token: $.admin.token
        }, {}, res => {
            console.log(res);
            window.location.reload();
        });
    }
</script>
